package com.ctd.utils.jes;

import java.security.KeyPair;
import java.security.NoSuchAlgorithmException;
import java.util.Map;

/**
 * @author cxw
 * @version 1.0
 * @date 2023-08-08 17:01
 * @description 生成公私钥对
 */
public class KeyGen {
    public static void main(String[] args) throws NoSuchAlgorithmException {
        KeyPair receiverKeyPair = EMsgHelperV2.generateKeyPair();
        Map<String, String> hexKeyPair = new EMsgHelperV2().parseKeyPair(receiverKeyPair);
        System.out.println("私钥(D)：" + hexKeyPair.get("priv"));
        System.out.println("公钥(Q)：" + hexKeyPair.get("pub"));
    }
}
